﻿Imports User
Imports Tool
Imports RunEnv
Imports Prime
Imports ERPPrime
Public Class Form1

    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Dim dlg As New dlgLogin
        Dim user As CUser
        user = dlg.ShowOpen("Default")
        If user Is Nothing Then
            Button2.Visible = False
        Else
            Button2.Visible = True
        End If
    End Sub

    'Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
    '    QueryGrid1.Cnn = CRunEnv.DBConnection.sqlConnection
    '    QueryGrid1.RecordSQL = "Select * From Table1"
    '    QueryGrid1.IsTransZeroToBlank = True
    '    QueryGrid1.Init()
    '    QueryGrid1.SumColumns = {"Columns1", "Columns3", "Columns5"}
    '    QueryGrid1.ColumnFooters = True
    '    'QueryGrid1.ColumnsWidth({"Columns2", "Columns6"}) = {40, 40}
    '    'QueryGrid1.ColumnsVisible({"Columns3", "Columns4", "Columns5"}) = {False, False, True}
    '    'QueryGrid1.FrozenColumn = "Columns3"

    '    QueryGrid1.ColumnsDefaultCellStyle(1).BackColor = Color.Black
    '    'QueryGrid1.ColumnsWidth({"Columns2", "Columns7"}) = {40, 40}
    '    QueryGrid1.ColumnsHeaderText("Columns2") = "第2列"
    '    QueryGrid1.RowsDefaultCellStyle(1).ForeColor = Color.Aqua

    '    QueryGrid2.Cnn = CRunEnv.DBConnection.sqlConnection
    '    QueryGrid2.RecordSQL = "Select * From Table2"
    '    QueryGrid2.ParentsColumns = "Columns0"
    '    QueryGrid2.LocalColumns = "Columns1"
    '    QueryGrid1.RegisterObserver(QueryGrid2)
    '    QueryGrid2.Init()
    '    QueryGrid2.ColumnsDefaultCellStyle("Columns4").Format = "f5"

    'End Sub

    'Private Sub QueryGrid2_RowDoubleClick(rowIndex As Integer)
    '    MsgBox(QueryGrid2.Rows(rowIndex).Cells(0).Value)
    'End Sub

    Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
        'For Each row As DataGridViewRow In QueryGrid2.SelectedRows
        '    MsgBox(row.Index)
        'Next
        Me.BillDetail1.Init("表体测试")
        Me.BillDetail1.BillNo = "123456"

    End Sub

    'Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
    '    Dim obj As New CPrimeManager
    '    obj.cnn = CRunEnv.DBConnection
    '    obj.InitCard("用户组管理", False, False)
    '    obj.ShowCard(True, True)
    'End Sub

    Private Sub 菜单ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 菜单ToolStripMenuItem.Click
        
    End Sub

    Private Sub 用户和组ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 用户和组ToolStripMenuItem.Click
        Dim userMana As New CUserManager
        userMana.ShowFrmUser()
    End Sub

    Private Sub 权限ToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles 权限ToolStripMenuItem1.Click
        Dim userMana As New CUserManager
        userMana.ShowFrmUserRight()
    End Sub

    Private Sub 更改口令ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 更改口令ToolStripMenuItem.Click
        Dim userMana As New CUserManager
        userMana.ShowUpdatePassword()
    End Sub

    Private Sub 颜色管理ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 颜色管理ToolStripMenuItem.Click
        Dim erpPrimeMana As New CERPPrimeManager
        erpPrimeMana.ShowFrmPrimeColor()

    End Sub

    Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
        BillDetail1.EditState = True
    End Sub

    Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
        BillDetail1.Save()
    End Sub

    Private Sub 尺码管理ToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles 尺码管理ToolStripMenuItem.Click
        Dim erpPrimeMana As New CERPPrimeManager
        erpPrimeMana.ShowFrmPrimeSize()
    End Sub
End Class
